<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>选项卡-小功能</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .box {
            width: 302px;
            margin: 100px auto;
            border: 1px solid #ddd;
        }

        .box .header {
            height: 35px;
            line-height: 35px;
        }

        .box .header span {
            float: left;
            width: 100px;
            border-right: 1px solid #fff;
            background: #ddd;
            text-align: center;
            color: #fff;
            cursor: pointer;
        }

        .box .header span:last-child {
            border-right: none;
        }

        .box .header .cur {
            background: #fff;
            color: #ddd;
            font-size: medium;
            font-weight: 100;
        }

        .box .content {
            line-height: 30px;
            font-size: 14px;
            padding: 5px;
            background-color: antiquewhite;
        }

        .box .content p {
            border-bottom: 1px solid #ddd;
        }
    </style>
</head>

<body>
    <div id="smartParty" class="box">
        <button @click="test">按我加1</button>
    </div>
    <script src="js/vue2.js"></script>
    <script>
        new Vue({
            el: '#smartParty',
            data: {
                boo: 0,
                boo1: 1
            },
            methods: {
                test() {
                    var val = 1;
                    var json = {
                        val: 10,
                        myFunc: function () {
                            val *= 2;
                        }
                    };
                    json.myFunc();
                    alert(json.val + val);
                }
            }
        });
    </script>
</body>

</html>